package org.jeecg.modules.politics.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.politics.entity.PoliticsStatus;
import org.jeecg.modules.politics.mapper.PoliticsStatusMapper;
import org.jeecg.modules.politics.service.PoliticsStatusService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  政治面貌
 * </p>
 *
 * @author liujiamiao
 * @email 2544296058@qq.com
 * @since 2020-10-21
 */
@Service
public class PoliticsStatusServiceImpl extends ServiceImpl<PoliticsStatusMapper, PoliticsStatus> implements PoliticsStatusService {

    @Override
    public Integer getIdByName(String name) {
        PoliticsStatus politicsStatus = baseMapper.selectOne(new QueryWrapper<PoliticsStatus>().eq("politics_name", name).select("politics_id"));
        return politicsStatus.getPoliticsId();
    }
}
